package com.bk.interceptor;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;
import com.jfinal.core.Controller;
import com.jfinal.kit.LogKit;
import com.utils.AuthUtils;

public class AuthInterceptor implements Interceptor {

	@Override
	public void intercept(Invocation inv) {
		Controller controller = inv.getController();
		if (AuthUtils.verify(controller)) {
			inv.invoke();
		} else {
			LogKit.info("login fail");
			controller.redirect("/bk/user");
		}
	}

}
